package com.common.sp;

/**
 * APP的一些数据存储，系统级设置
 * Created by wgf on 2016/7/25.
 *
 * @author wgf
 * @since v3.8
 */
public class AppSp {

    public static void setIsFirstEnter(boolean isFirstEnter) {
        SharedPreferUtil.getInstance().putBoolean(SharedPreferUtil.APP_INFO, "isFirstEnter", isFirstEnter);
    }

    /** 是否是第一次打开APP */
    public static boolean isFirstEnter() {
        return SharedPreferUtil.getInstance().getBoolean(SharedPreferUtil.APP_INFO, "isFirstEnter", true);
    }

    public static void setIsShowGuide(boolean isFirstShowGuide) {
        SharedPreferUtil.getInstance().putBoolean(SharedPreferUtil.APP_INFO, "isFirstShowGuide", isFirstShowGuide);
    }

    /** 是否是第一次 */
    public static boolean isShowGuide() {
        return SharedPreferUtil.getInstance().getBoolean(SharedPreferUtil.APP_INFO, "isFirstShowGuide", false);
    }

    public static void setIsOpenJPush(boolean isOpenJPush) {
        SharedPreferUtil.getInstance().putBoolean(SharedPreferUtil.APP_INFO, "isOpenJPush", isOpenJPush);
    }

    /** 是否打开极光推送 */
    public static boolean isOpenJPush() {
        return SharedPreferUtil.getInstance().getBoolean(SharedPreferUtil.APP_INFO, "isOpenJPush", true);
    }

    /**
     * 获取是否显示更新信息
     *
     * @return
     */
    public static boolean isShowUpdateInfo() {
        return SharedPreferUtil.getInstance().getBoolean(SharedPreferUtil.APP_INFO, "isShowUpdateInfo", false);
    }

    /**
     * 设置是否显示更新信息
     */
    public static void setIsShowUpdateInfo(boolean isShowUpdateInfo) {
        SharedPreferUtil.getInstance().putBoolean(SharedPreferUtil.APP_INFO, "isShowUpdateInfo", isShowUpdateInfo);
    }

    /** 获取版本信息 */
    public static String getVersionInfo() {
        return SharedPreferUtil.getInstance().getString(SharedPreferUtil.APP_INFO, "versionInfo", "暂无版本信息");
    }

    public static void setVersionInfo(String versionInfo) {
        SharedPreferUtil.getInstance().putString(SharedPreferUtil.APP_INFO, "versionInfo", versionInfo);
    }

    /**设置是否存在新版本app*/
    public static void setHasNewVersion(boolean hasNew) {
        SharedPreferUtil.getInstance().putBoolean(SharedPreferUtil.APP_INFO, "hasNewVersion", hasNew);
    }

    public static boolean getHasNewVersion( ) {
      return   SharedPreferUtil.getInstance().getBoolean(SharedPreferUtil.APP_INFO, "hasNewVersion",false);
    }

    /**设置是否在登入页显示语音验证*/
    public static void setVoiceCodeState(boolean shouldShow) {
        SharedPreferUtil.getInstance().putBoolean(SharedPreferUtil.APP_INFO, "voiceCodeState", shouldShow);
    }

    public static boolean getVoiceCodeState( ) {
        return   SharedPreferUtil.getInstance().getBoolean(SharedPreferUtil.APP_INFO, "voiceCodeState",false);
    }

}
